/*
 * @lc app=leetcode.cn id=2089 lang=typescript
 *
 * [2089] 找出数组排序后的目标下标
 */

// @lc code=start
function targetIndices(nums: number[], target: number): number[] {
    nums.sort((a, b) => a - b);
    let list: number[] = [];
    for (let i = 0; i < nums.length; i++) {
        const element = nums[i];
        if (target === element) {
            list.push(i);
        }
    }
    return list;
}
// @lc code=end
